Skip to main content
List Organisational Units
curl --request GET \
  --url https://{tenant_name}.{region}.techwolf.ai/organisational_units \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://{tenant_name}.{region}.techwolf.ai/organisational_units"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://{tenant_name}.{region}.techwolf.ai/organisational_units', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenant_name}.{region}.techwolf.ai/organisational_units",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://{tenant_name}.{region}.techwolf.ai/organisational_units"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://{tenant_name}.{region}.techwolf.ai/organisational_units")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{tenant_name}.{region}.techwolf.ai/organisational_units")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "count": 3,
  "results": [
    {
      "external_id": "5cbdbdbe-5f44-4423-8157-520f8a2f429a",
      "name": "Engineering",
      "total_nr_of_employees": 20,
      "active": true,
      "parent_id": null
    },
    {
      "external_id": "6129e3f1-663f-44ea-aa3f-2ce1077b834c",
      "name": "IT",
      "total_nr_of_employees": 6,
      "active": true,
      "parent_id": "5cbdbdbe-5f44-4423-8157-520f8a2f429a"
    },
    {
      "external_id": "62d2c013-ab77-410e-b5fb-2f96eed9c1db",
      "name": "Finance",
      "total_nr_of_employees": 8,
      "active": true,
      "parent_id": null
    }
  ]
}
[
{
"title": "401 Unauthorized",
"description": "OAuth access token is missing, invalid or expired."
}
]
[
{
"title": "403 Forbidden",
"description": "You don't have access to this resource."
}
]
[
{
"title": "404 Not Found",
"description": "Unknown parent_id for this resource. This Organisational Unit does not exist yet."
}
]
[
{
"title": "405 Method Not Allowed",
"description": "This method is not allowed for the requested URL."
}
]
"max connections reached: <limit>"
[
{
"title": "503 Service Unavailable",
"description": "The Skill Engine API is currently not available. Please contact TechWolf or try again later."
}
]

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Query Parameters

limit
integer
default:100

The maximal number of entities returned, ordered by the last_updated field and external_id.

Required range: 1 <= x <= 200
Example:

50

offset
integer
default:0

The applied offset for returned entities, results starting from offset up to offset + limit.

Required range: x >= 0
parent_id
string

This parameter can be used to only include Organisational Units with the specified parent_id as their direct parent. If parent_id="null", only root Organisational Units are included. If the parameter is not set, all entities will be included.

Example:

"c3903505-eb84-42dc-a79f-5d8b1fe897b7"

Response

OK

count
integer
required

Total number of Organisational Unit objects stored in the system. If filtered by parent_id, only the matching units are counted.

Required range: x >= 0
Example:

3

results
Organisational Unit · object[]
required

Subset of Organisational Unit starting from offset up to offset + limit.

Example:
[
{
"external_id": "5cbdbdbe-5f44-4423-8157-520f8a2f429a",
"name": "Engineering",
"total_nr_of_employees": 20,
"active": true,
"parent_id": null
},
{
"external_id": "6129e3f1-663f-44ea-aa3f-2ce1077b834c",
"name": "IT",
"total_nr_of_employees": 6,
"active": true,
"parent_id": "5cbdbdbe-5f44-4423-8157-520f8a2f429a"
},
{
"external_id": "62d2c013-ab77-410e-b5fb-2f96eed9c1db",
"name": "Finance",
"total_nr_of_employees": 8,
"active": true,
"parent_id": null
}
]